package com.zhuiwei.springboottask.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author zhuiwei
 * @version 2019/05/27
 */
@Service
public class AsyncService {
    /**
     * @Async 表明方法通过异步调用，可以替代多线程处理
     * @throws InterruptedException
     */
    @Async
    public void hello() throws InterruptedException {
        Thread.sleep(3000);
        System.out.println("处理数据中...");
    }
}
